// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import Element from 'element-ui';
import VueResource from 'vue-resource';
import 'element-ui/lib/theme-chalk/index.css';
Vue.config.productionTip = false;
Vue.use(Element);
Vue.use(VueResource);
require("../mock/mock.js");
import * as echarts from 'echarts';
Vue.prototype.$echarts = echarts

import api from "../axios/api"

import VueParticles from 'vue-particles'
/* eslint-disable no-new */
//面包屑导航使用
// var routeList = [];
// router.beforeEach((to, from, next) => {
//   var index = -1;
//   for(var i = 0; i < routeList.length; i++) {
//     if(routeList[i].name == to.name) {
//       index = i;
//       break;
//     }
//   }
//   if (index !== -1) {
// //如果存在路由列表，则把之后的路由都删掉
//     routeList.splice(index + 1, routeList.length - index - 1);
//   } else if(to.name != '登录'){
//     routeList.push({"name":to.name,"path":to.fullPath});
//   }
//   console.log("-----------66--------------")
//   console.log(routeList)
//
//   to.meta.routeList = routeList;
//   next()
// });
//面包屑导航处理结束
// router.beforeEach((to,from,next)=>{
//   //alert(to.path);
//   if(to.path == '/login' || to.path == '/register'){
//     next();
//   }else{
//     api.setDataFromAxios("/api/TestWeb/#",null,'get',null).then(
//       function (dto) {
//         if (dto.code==200){
//           next();
//         } else{
//           alert("请登录");
//           //Vue.$message.error("请登录");
//           next({
//             path:"/login"
//           });
//         }
//       }
//     );
//     //alert('您还没有登录，请先登录');
//
//   }
// })

new Vue({
  el: '#app',
  router,
  components: { App },
  template: '<App/>'
})


